//
//  PaddingDemo.swift
//  SwiftUIAnimation
//
//  Created by 李煜 on 2024/8/21.
//

import SwiftUI

struct PaddingDemo: View {
  var body: some View {
    //padding的使用方式
    Group {
      Text("Submit")
        .padding()
        
      Text("Submit")
        .padding(.horizontal, 50)
        .padding(.vertical, 20)
      
      Text("Submit")
        .padding(EdgeInsets(top: 10, leading: 20, bottom: 30, trailing: 40))
      
      Text("Submit")
        .padding([.bottom, .trailing], 20)
    }
    .font(.system(.largeTitle, design: .rounded))
    .bold()
    .foregroundStyle(.white)
    .background(.green)
    .clipShape(.capsule)
  }
}

#Preview {
  PaddingDemo()
}
